package com.qiyue.admin.entity.base.dict;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.qiyue.common.model.BaseEntity;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;

/**
 * created by yebinghuan on 2018/4/2
 *
 *  数据字典字段
 */
@Entity
@Table( name = "sys_dict_value")
public class DictValue extends BaseEntity {


    /**
     * 用于标识
     */
    @ApiModelProperty( value = "字段编码")
    @Column( name = "code")
    private String code;


    @ApiModelProperty( value = "值")
    @Column( name = "value" , length = 64)
    private  String value;

    @ApiModelProperty( value = "默认标签")
    @Column( name = "label_default" , length = 64)
    private String labelDefault;

    @ApiModelProperty( value = "英文标签")
    @Column( name = "label_en_US")
    private String labelEn;

    @ApiModelProperty( value = "中文标签")
    @Column( name = "label_zh_CH")
    private String labelZhCH;


    /**
     * 排序字段
     */
    @ApiModelProperty( value = "编号")
    @Column( name = "order_num")
    private int orderNum;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getLabelDefault() {
        return labelDefault;
    }

    public void setLabelDefault(String labelDefault) {
        this.labelDefault = labelDefault;
    }

    public String getLabelEn() {
        return labelEn;
    }

    public void setLabelEn(String labelEn) {
        this.labelEn = labelEn;
    }

    public String getLabelZhCH() {
        return labelZhCH;
    }

    public void setLabelZhCH(String labelZhCH) {
        this.labelZhCH = labelZhCH;
    }

    public int getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(int orderNum) {
        this.orderNum = orderNum;
    }

    /**
     * 级联
     */
    //字典类型 多对一
    private DictType dictType;

    @ManyToOne( fetch = FetchType.LAZY)
    @JsonIgnore
    public DictType getDictType() {
        return dictType;
    }

    public void setDictType(DictType dictType) {
        this.dictType = dictType;
    }
}
